package cn.tedu.milktea.admin.mapper;

import cn.tedu.milktea.pojo.entity.Category;
import cn.tedu.milktea.pojo.vo.CategorySimpleVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface CategoryMapper {

    /**
     * 查询类别统计信息
     *
     *
     * @return 类别的统计信息
     */
    List<CategorySimpleVO> getCategoryStatistics();

    @Insert("insert into category values(null,#{name})")
    void insert(Category category);
    @Select("select * from category")
    List<Category> select();

    @Delete("delete from category where id=#{id}")
    void deleteById(int id);
}
